package com.job.springSea.work0722;

import java.util.Scanner;

/**
 * @author 于春海
 * @version 1.0
 * @since 2022-07-23 12:43:29
 */
public class AgeDemo {
    public static void main(String[] args) {
        Student student=new Student();
        Scanner sc = new Scanner(System.in);
        Integer number=sc.nextInt();
        try {
            if(number>28||number<18){
                throw new AgeException(number);
            }
            student.setAge(number);
            System.out.println("学生的年龄为:"+student.getAge());
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}